﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>无标题页</title>
    <script type="text/javascript">
        function Person(name,age)
        {
            this.Name=name;
            this.Age=age;
            this.SayHello=function() //SayHello后面不能跟括号
            {
                alert("My name is "+this.Name+", I am "+this.Age+" years old");
            }
        }
        var p1 = new Person("rrr",30);
        p1.SayHello();
    </script>
</head>
<body>

</body>
</html>
